package khleuven.mondzorg;

import android.content.Context;
import android.util.Log;
import android.widget.Toast;

public class Logger {
	
	public static boolean log = false;
	public static boolean logdb = true;
	public static boolean logdomain = false;
	public static boolean logapp  = false;
	public static boolean logtest = false;

	public Logger() {
		
	}
	public static void logAsUserLoadingFeedback(Context applicationContext, int rid, String loadinginfo){
		
		String translated_message = applicationContext.getResources().getString(rid);
		Toast.makeText(applicationContext, translated_message, Toast.LENGTH_SHORT).show() ;
		
		Log.v(LoggingKeyWords.TOAST.name(), loadinginfo);
	}
	public static void logDB(String tolog){
		if(log && logdb){
			Log.v(LoggingKeyWords.DB.name(),tolog);
		}
	}
	
	public static void logDomain(String tolog){
		if(log && logdomain){
			Log.v(LoggingKeyWords.DOMAIN.name(),tolog);
		}
	}
	
	public static void logApp(String tolog){
		if(log && logapp){
			Log.v(LoggingKeyWords.APP.name(),tolog);
		}
	}
	
	public static void logTest(String tolog){
		if(log && logtest){
			Log.v(LoggingKeyWords.TEST.name(),tolog);
		}
	}
	
	public enum LoggingKeyWords {
		TEST,
		APP,
		DB,
		DOMAIN, 
		TOAST;
	}

}
